package cglgu.trellis.chado.das2.cglgu.registry;

/*
 * $Id: RegistryManagerFactory.java 191 2011-03-27 00:38:22Z sundaram.georgetown@gmail.com $
 * $Author: sundaram.georgetown@gmail.com $
 * $Date: 2011-03-27 00:38:22 +0000 (Sun, 27 Mar 2011) $
 * $Rev: 191 $
 * $HeadURL: http://genomancer.googlecode.com/svn/branches/gu-dev-branch/tengcha/src/cglgu/trellis/chado/das2/cglgu/registry/RegistryManagerFactory.java $
 */

import cglgu.trellis.chado.das2.cglgu.registry.RegistryManager;

public class RegistryManagerFactory  {

    private static RegistryManagerFactory instance = null;

    protected RegistryManagerFactory() {

    }

    public static RegistryManagerFactory getInstance(){

	if (instance == null){
	    instance = new RegistryManagerFactory();
	}

	return instance;
    }

    public static RegistryManager create(String type){

	RegistryManager regman;

	int fatalCtr = 0;

	if (type == null){
	    regman = RegistryManager.getInstance();
	}
	else {
	    System.err.println("The following RegistryManager type is not supported: " + type);
	    System.exit(1);
	}

	return regman;
    }
}